import PlayAudio from '@/components/PlayAudio/PlayAudio.vue'
import Cover from './Cover.vue'
import PlayMv from './PlayMv.vue'
import Header from './Header.vue'
import SongList from './SongList.vue'
import Comment from './Comment.vue'


export default {
  name: 'Home',
  components: {
    Header,
    SongList,
    Cover,
    PlayAudio,
    PlayMv,
    Comment,
  },
  data() {
    return {
      songId:0,
      SongListObj: {
        musicList: [],
        audioisplay: false,
      },
      // 封面组件
      coverObj: {
        id: 0,
        songDuration: 0,
        audioisplay: false,
        currentTime: 0
      },
      commentObj:{
        id: 0,
      },
      // Mv组件
      MvObj:{
        MvId: 0
      },
      //音频播放
      playAudioObj: {
        songUrl: '',
        audioisplay: false,
        isclick:true
      },
    }
  },
  methods: {
    // Header返回歌曲列表
    StorageMusicList(v) {
      this.SongListObj.musicList = v
    },
    //SongList返回值
    //点击歌曲id
    StorageSongId(v) {
        this.songId=v
    },
    //点击歌曲url
    StorageSongUrl(v) {
      this.playAudioObj.songUrl = v
    },
    //点击歌曲Mvid
    StorageMvId(v) {
      this.MvObj.MvId = v
    },
    //歌曲状态
    isClick() {
       this.playAudioObj.isclick = !this.playAudioObj.isclick
    },
    //playAudio返回值
    //歌曲总时长
    StorageSongDuration(v) {
      this.coverObj.songDuration = v
      this.coverObj.id = this.songId
      this.commentObj.id = this.songId
    },
    //歌曲当前播放时间
    StorageCurrentTime(v) {
      this.coverObj.currentTime = v
    },
    // 歌曲播放状态
    PlayAudioStroageSongState(v) {
      this.SongListObj.audioisplay = v
      this.coverObj.audioisplay = v
    },
  }
}
